package chaoyue.study.io;

import java.io.FileReader;

public class FileReaderTest {
    public static void main(String[] args) throws Exception {
        FileReader fileReader = new FileReader("/Users/chaoyue/Downloads/test.txt");
        char[] buffer = new char[8];
        int readCount;
        do {
            readCount = fileReader.read(buffer);
            if (readCount != -1) {
                System.out.println(new String(buffer, 0, readCount));
            }
        } while (readCount != -1);
        fileReader.close();
    }
}
